package com.zkjl.protect_business.repository;

import com.zkjl.protect_business.entity.Template;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

import java.util.List;

public interface TemplateRepository extends ElasticsearchRepository<Template, String> {

    /**
     * 根据hash获取模板
     * @param hash
     * @return
     */
    Template findByHash(String hash);

    /**
     * 获取业务分类下面的所有模板
     * @param businessId
     * @return
     */
    List<Template> findAllBybusinessId(String businessId);

    /**
     * 根据业务id删除
     * @param businessId
     * @return
     */
    Boolean deleteAllByBusinessId(String businessId);


}
